package com.woniuxy.controller;

import com.woniuxy.entity.utils.ResponseEntity;
import com.woniuxy.service.OrderService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService2 orderService;

    @PostMapping("/{pid}/{num}")
    public ResponseEntity generateOrder(@PathVariable Integer pid, @PathVariable Integer num){

        return orderService.generateOrder(pid,num);
    }

    @GetMapping("/{name}/{minPrice}/{maxPrice}")
    public ResponseEntity findProductList(@PathVariable String name,@PathVariable double minPrice,@PathVariable double maxPrice){
        return orderService.findProductList(name,minPrice,maxPrice);
    }
}
